package com.ce.pub.process.action;

import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.impl.RepositoryServiceImpl;
import org.activiti.engine.impl.persistence.entity.ExecutionEntity;
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity;
import org.activiti.engine.impl.pvm.PvmTransition;
import org.activiti.engine.impl.pvm.process.ActivityImpl;
import org.activiti.engine.query.Query;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.task.Task;
import org.activiti.engine.task.TaskQuery;

import com.ce.framework.datamaintain.action.DataMaintainAction;
import com.ce.framework.exception.AppException;
import com.ce.pub.process.logic.ProcessDealService;
import com.opensymphony.xwork2.ActionContext;





public class ProcessTaskAction extends  DataMaintainAction {

	private static final long serialVersionUID = 1L;
	private ProcessDealService processDealService;
	private String processInstanceId;

    public void readProcessPng()
            throws Exception {
        InputStream imageStream = processDealService.getProcessTaskImg(processInstanceId);

        // 输出资源内容到相应对象
        byte[] b = new byte[1024];
        int len;
        while ((len = imageStream.read(b, 0, 1024)) != -1) {
            this.getResponse().getOutputStream().write(b, 0, len);
        }
    }
    
    public String processView()
            throws Exception {
       return "processView";
    }

	public ProcessDealService getProcessDealService() {
		return processDealService;
	}

	public void setProcessDealService(ProcessDealService processDealService) {
		this.processDealService = processDealService;
	}

	public String getProcessInstanceId() {
		return processInstanceId;
	}

	public void setProcessInstanceId(String processInstanceId) {
		this.processInstanceId = processInstanceId;
	}
	
    

}
